﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master" AutoEventWireup="true" %>
    <%@ Register src="Footer.ascx" tagname="Footer" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>搜索</title>
    <style>
        #mypage .ui-header{ background:#f9384d;}
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="pages" runat="server">
    <!--S page -->
 <div data-role="page" id="mypage">
        <!--S header -->
        <div data-role="header">
            <table width="98%" border="0" cellspacing="0" cellpadding="0" style="margin-left:10px;">
                <tr>
                   
                    <td >
                        <input type="search" id="keyword" name="keyword" placeholder="请输入搜索关键词">
                    </td>
                    <td>
                        <input name="" type="button" value="搜索" onclick="SearchProduct();">
                    </td>
                </tr>
            </table>
        </div>
        <!--E header -->
        <!--S content -->
        <div role="main" class="ui-content">
         
            <div class="search">
            <!--s proList-->
            <div class="hot_search">
                <h3>
                    热门搜索：</h3>
                 <ul class="search_box">
                    
                </ul>
                <%--<button id="btnMore" data-icon="refresh" style="width: 95%; margin-left: auto; margin-right: auto;">
                    显示更多</button>--%>
            </div>
            </div>
            <!--e proList-->
        </div>  
    <!--S footer -->
	<div data-role="footer" data-position="fixed" data-tap-toggle="false">
    
                <uc1:Footer ID="Footer1" runat="server" MenuId="S" />    
    </div>
    <!--E footer -->
</div>
<!--E page -->
    <script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
    <script type="text/javascript">
        function queryData() {
            var handler = $('.search_box').listviewHandler();
            handler.initialize({
                loaderBtn: $('#btnMore'), //加载数据按钮（点击加载下一页）
                emptyHtml: '无记录', //无记录时显示此html
                itemTemplate: '<li onclick="{ClickHtml}" data-ajax="false">{Title}</li>', //项模板
                pageIndex: 1, //页码（从1起算）
                pageSize: 20, //页大小
                totalCount: 999, //总记录数
                itemHandler: function (data, itemTemplate, container) {//数据各项处理
                    if (data.Url) {
                        data.ClickHtml = "location.href='" + data.Url + "'";
                    }
                    return itemTemplate.format(data);
                },
                command: 'Pub.LoadAdsList',
                parameter: { PositionCode: "Search" }
            });
            handler.nextPage();
        }
        $(function () {
            queryData();
        })



        $.cookie('After', $.cookie('CurrentPage'));
        $.cookie('CurrentPage', 'search');

        var After = $.cookie('After');
        var Current = $.cookie('CurrentPage');

        var _hmt = _hmt || [];
        var path = 'search|path|' + Current + '|' + After;
        _hmt.push(['_trackEvent', path, 'enter', 'search']);
        _hmt.push(['_trackEvent', 'page', 'view', 'search']);


        function SearchProduct() {
            location.href = "ProductListS.aspx?keyword=" + $("#keyword").val();
        }
    </script>
</asp:Content>
